package com.wc.acwing.贪心.小苹果;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/15 9:16
 * @description 小苹果
 * https://www.acwing.com/problem/content/description/5310/
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int last = n;
        int day = 0;
        int ans = -1;
        while (n > 3) {
            ++day;
            if (ans == -1 && (last - 1) % 3 == 0) {
                ans = day;
            }
            n = n - (n - 1) / 3 - 1;
            last = n;
        }
        day += n;
        if (ans == -1) {
            ans = day;
        }
        System.out.println(day + " " + ans);
    }
}
